package com.vshining.cryptoki.jna.pkcs11t;

import com.sun.jna.NativeLong;
import com.vshining.cryptoki.CryptokiException;
import com.vshining.cryptoki.CryptokiResultValue;
import com.vshining.cryptoki.jna.ClassConvertor;

/**
 * @author Shining Wang <shiningwang@vshining.com>
 */
@SuppressWarnings("unused")
public abstract class CK_RV extends CryptokiResultValue {
    public static void ckAssertReturnValueOK(NativeLong rv) throws CryptokiException {
        long ret = ClassConvertor.ckUlongTojLong(rv);
        if (ret != CKR_OK)
            throw new CryptokiException(ret);
    }

}
